package com.zhuoyue.web.core.task;

import com.zhuoyue.common.utils.DateUtils;
import com.zhuoyue.system.service.ISysImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * @author zhanghui
 * @date 2021/11/5 15:30
 */
@Configuration
@EnableScheduling
public class ClearImageTask {
    @Autowired
    private ISysImageService sysImageService;

    /**
     * 每周二下午2点执行
     */
    @Scheduled(cron = "0 0 14 * * 2")
//    @Scheduled(cron = "0/20 * * * * *")
    private void clearStoreImg() {
        System.out.println("测试定时任务: " + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
//        sysImageService.removeStoreImg();
    }
}
